package io.xiyou.goods.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.xiyou.goods.api.IGoodsService;
import io.xiyou.goods.api.bo.CreateOrderBO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品接口
 *
 * @author 西柚
 * @date 2021-11-06 17:15:14
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/goods")
@Api(value = "/goods", tags = "商品接口")
public class GoodsController {

    @Autowired
    private IGoodsService goodsService;

    @ApiOperation("创建订单")
    @PostMapping("/createOrder")
    public Long createOrder(@RequestBody CreateOrderBO createOrderBO) throws Exception {
        return goodsService.createOrder(createOrderBO);
    }


}
